﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Plugin_Interfaces;
using PMKB_Web.pluginsCode;

namespace PMKB_Web.Areas.plugin.Controllers
{
    public partial class AllController : Controller
    {
        //
        // GET: /plugin/All/

        public virtual ActionResult Index()
        {

            var plugins = SiteUtils.plugins.Select(item => new KVP.KVPNew<string,MVCPLugin>( item.Key, PluginControllerFactory.pluginFromName(item.Key,"") as MVCPLugin )).ToList();
            //string[] plugins =this.HttpContext.Application["Plugins"] as string[];
            return View(plugins);
        }
        public virtual ActionResult GotoPlugin(string id)
        {
            return RedirectToAction("Index",id);
        }
    }
}
